package com.googlecode.adaboost.classifier;

import com.googlecode.adaboost.module.Module;
import com.googlecode.adaboost.trainer.DataElement;
import com.googlecode.adaboost.trainer.TrainingData;

/**
 * @version Create on 2012-11-11
 * @author Yinzi Chen
 */

public interface WeakClassifier extends Module {

	/**
	 * Write your own code to initialize the weak classifier
	 * 
	 * @param trainingData
	 * @param probability
	 * @return errorRate
	 */
	void initClassifier(TrainingData trainingData, double[] probability);

	/**
	 * After initialize the weak classifier, it can make decision
	 * 
	 * @param data
	 * @return -1 or 1
	 */
	int makeDecision(DataElement data);

	/**
	 * Dump information
	 */
	void dumpClassifier();

	double getRate(DataElement data);
}
